﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterCar.master" AutoEventWireup="true"
    Async="true" CodeFile="results.aspx.cs" Inherits="car_insurance_results" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <!-- Facebook Conversion Code for GG Customers -->

    <script type="text/javascript">
        (function() {
            var _fbq = window._fbq || (window._fbq = []);
            if (!_fbq.loaded) {
                var fbds = document.createElement('script');
                fbds.async = true;
                fbds.src = '//connect.facebook.net/en_US/fbds.js';
                var s = document.getElementsByTagName('script')[0];
                s.parentNode.insertBefore(fbds, s);
                _fbq.loaded = true;
            }
        })();
        window._fbq = window._fbq || [];
        window._fbq.push(['track', '6014983617962', { 'value': '0.00', 'currency': 'USD'}]);
    </script>

    <noscript>
        <img height="1" width="1" alt="" style="display: none" src="https://www.facebook.com/tr?ev=6014983617962&amp;cd[value]=0.00&amp;cd[currency]=USD&amp;noscript=1" /></noscript>
    <!-- Facebook Conversion Code for GG Leads -->

    <script type="text/javascript">
        var fb_param = {};
        fb_param.pixel_id = '6012661234728';
        fb_param.value = '0.01';
        fb_param.currency = 'USD';
        (function() {
            var fpw = document.createElement('script');
            fpw.async = true;
            fpw.src = '//connect.facebook.net/en_US/fp.js';
            var ref = document.getElementsByTagName('script')[0];
            ref.parentNode.insertBefore(fpw, ref);
        })();
    </script>

    <noscript>
        <img height="1" width="1" alt="" style="display: none" src="https://www.facebook.com/offsite_event.php?id=6012661234728&amp;value=0.01&amp;currency=USD" /></noscript>

    <script type="text/javascript">
        $(document).ready(function() {
            $(".fancybox-login").fancybox({
                maxWidth: 800,
                maxHeight: 600,
                fitToView: false,
                width: '300px',
                height: '400px',
                autoSize: false,
                closeClick: false,
                openEffect: 'fade',
                closeEffect: 'fade',
                padding: '0',
                type: 'iframe',
                closeBtn: false,
                helpers: {
                    overlay: { closeClick: false }
                }
            });

            if (readCookie("GGMobileQuote") == null && document.getElementById('<%= hdnResults.ClientID%>').value > 0) {
                $("#fancybox-manual-a").trigger('click');
            }
        });
        function readCookie(name) {
            var nameEQ = name + "=";
            var ca = document.cookie.split(';');
            for (var i = 0; i < ca.length; i++) {
                var c = ca[i];
                while (c.charAt(0) == ' ') c = c.substring(1, c.length);
                if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
            }
            return null;
        }
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:Label ID="lblAdvertiser" runat="server"></asp:Label>
    <div class="container">
        <div id="divLoading" style="position: fixed; top: 0; left: 0; background-color: gray;
            filter: alpha(opacity=90); opacity: 0.8; width: 100%; height: 100%;">
            <table style="width: 100%; height: 300px">
                <tr>
                    <td align="center" valign="middle">
                        <img src="../images/loader/loader.gif" alt="Loading" width="66" height="66" align="absmiddle" />
                    </td>
                </tr>
            </table>
        </div>
        <div id="divContent" style="margin-top: 30px;">
            <div id="divResults" runat="server" visible="true">
                <asp:UpdatePanel ID="upnlResult" runat="server">
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="dlCarResults" EventName="Load" />
                    </Triggers>
                    <ContentTemplate>
                        <div class="radius-box-gen">
                            <div style="float: left; margin-left: 10px; margin-right: 20px;">
                                <a href="tel:022688222">
                                    <img src="../images/phone-no.jpg" width="144" height="20" alt="" /></a></div>
                            <div style="float: left;">
                                <asp:Button runat="server" ID="btnNewQuote" Text="<%$Resources:CarMenu,NewQuote%>"
                                    CssClass="new-quote-button" OnClick="btnNewQuote_Click" Width="92" />
                            </div>
                            <div style="position: absolute; margin-top: 43px; margin-left: 205px;">
                                <img src="../images/dog-chac-search.jpg" width="64" height="34" alt="" />
                            </div>
                            <div class="result-heading-radius">
                                <asp:Label ID="lblNoResultMessage" runat="server"></asp:Label></div>
                            <asp:DataList runat="server" ID="dlCarResults" OnItemDataBound="dlCarResults_ItemDataBound"
                                OnItemCommand="dlCarResults_ItemCommand">
                                <ItemTemplate>
                                    <div class="search-box">
                                        <div class="search-box-title">
                                            <div class="package-title">
                                                <asp:Label ID="lblPackage" runat="server"></asp:Label></div>
                                            <div class="class-title">
                                                <asp:Label ID="lblInsuranceClass" runat="server"></asp:Label></div>
                                        </div>
                                        <div class="small-search-box">
                                            <div runat="server" id="divProvider">
                                            </div>
                                        </div>
                                        <div class="price-box" runat="server" id="divbgimage">
                                            <span style="text-decoration: line-through; font-size: 16px; color: #fff;">
                                                <asp:Label runat="server" ID="lblPremiumAmount" Text="-"></asp:Label></span><br />
                                            <asp:Literal runat="server" ID="lblSpecial"></asp:Literal>
                                            <asp:Label runat="server" ID="lblPromotionPrice" Text="-"></asp:Label>
                                            <span style="font-size: 12px; padding-left: 2px;">
                                                <asp:Label runat="server" ID="lblBhat"></asp:Label></span>
                                        </div>
                                        <div class="icons">
                                            <div class="detail-icon detail-expand-btn">
                                                <img src="../images/detail.jpg" width="55" height="51" alt="" /></div>
                                            <div class="email-icon">
                                                <asp:ImageButton ID="imgEmailQuote" runat="server" ImageUrl="../images/email.jpg"
                                                    CommandName="Email" alt="Email Quote" Width="55" Height="51" BorderWidth="0"
                                                    OnClientClick="return ConfirmEmail();" />
                                            </div>
                                            <div class="call-icon">
                                                <a href="#">
                                                    <asp:ImageButton ID="ibtnCallMe" runat="server" ImageUrl="../images/call.jpg" CommandName="CallMe"
                                                        alt="Call Me" Width="55" Height="51" BorderWidth="0" />
                                                </a>
                                            </div>
                                            <div class="buy-icon">
                                                <a href="#">
                                                    <asp:ImageButton ID="imgBuyNow" runat="server" ImageUrl="../images/buy.jpg" CommandName="Buy"
                                                        alt="Buy Now" Width="55" Height="51" BorderWidth="0" />
                                                </a>
                                            </div>
                                        </div>
                                        <div class="content" style="display: none;">
                                            <div class="result-detail">
                                                <table width="225" border="0" align="center" cellpadding="1" cellspacing="1">
                                                    <tr>
                                                        <td width="98" class="text-detail">
                                                            <asp:Label ID="lblTitleGarage" runat="server"></asp:Label>
                                                        </td>
                                                        <td width="120" class="text-detail">
                                                            <asp:Label ID="lblGarage" runat="server"></asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td bgcolor="#dddddd" class="text-detail">
                                                            <asp:Label ID="lblTitleMakeModel" runat="server"></asp:Label>
                                                        </td>
                                                        <td bgcolor="#dddddd" class="text-detail">
                                                            <asp:Label ID="lblMakeModel" runat="server"></asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="text-detail">
                                                            <asp:Label ID="lblTitleCarYear" runat="server"></asp:Label>
                                                        </td>
                                                        <td class="text-detail">
                                                            <asp:Label ID="lblCarYear" runat="server"></asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td bgcolor="#dddddd" class="text-detail">
                                                            <asp:Label ID="lblTitleExcess" runat="server"></asp:Label>
                                                        </td>
                                                        <td bgcolor="#dddddd" class="text-detail">
                                                            <asp:Label ID="lblExcess" runat="server"></asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="text-detail">
                                                            <asp:Label ID="lblTitleSumInsure" runat="server"></asp:Label>
                                                        </td>
                                                        <td class="text-detail">
                                                            <asp:Label ID="lblSumInsure" runat="server"></asp:Label>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </div>
                                        </div>
                                    </div>
                                    <div style="display: none;">
                                        <asp:Image ID="imgProviderCompanyLogo" runat="server" ImageUrl="../images/result-logos/dhipaya.jpg"
                                            Width="91" Height="34" AlternateText="" />
                                        <asp:Label runat="server" ID="lblProviderCompanyID" Text="0" Visible="false" />
                                        <asp:Label runat="server" ID="lblCarResultID" Text="0" Visible="false" />
                                        <asp:Label runat="server" Text="Coverage" ID="lblPlanName" Visible="false"></asp:Label>
                                        <asp:Label runat="server" Text="Coverage" ID="lblSpecialNBC" Visible="false"></asp:Label>
                                    </div>
                                </ItemTemplate>
                            </asp:DataList>
                            <div class="chac">
                                <div style="position: absolute; margin-top: 35px; margin-left: 5px;">
                                    <img src="../images/hippo-chac.png" width="108" height="86" alt="" />
                                </div>
                            </div>
                        </div>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </div>
            <div id="divCallUs" runat="server" visible="false">
                <div class="radius-box-gen">
                    <div id="divCallMe" runat="server">
                        <div class="heading-radius-small">
                            <asp:Label ID="lblApplicationTitle" runat="server" Text=""></asp:Label>
                        </div>
                        <div class="field-message">
                            <%--<asp:Label ID="lblNomatch" runat="server" Text=""></asp:Label><br />--%>
                            <asp:Label ID="lblCallUsBack" runat="server" Text=""></asp:Label><br />
                            <asp:Label ID="lblCallUs" runat="server"></asp:Label><br />
                            <a href="tel:022688222">
                                <img src="../images/phone-no.jpg" width="144" height="22" alt="call" style="vertical-align: middle;
                                    padding-top: 2px;" /></a>
                        </div>
                        <div class="field-row">
                            <asp:DropDownList ID="ddlCallMeTime" runat="server" CssClass="dropdown-fields">
                                <asp:ListItem Value="-1" Text="<%$Resources:CarMenu,BestTimetoCall %>" />
                                <asp:ListItem Value="1" Text="<%$Resources:CarMenu,CallMeMorning %>" />
                                <asp:ListItem Value="2" Text="<%$Resources:CarMenu,CallMeAfternoon %>" />
                                <asp:ListItem Value="3" Text="<%$Resources:CarMenu,CallMeEvening %>" />
                                <asp:ListItem Value="4" Text="<%$Resources:CarMenu,CallMeAnytime %>" />
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator ID="rfvCallMeTime" ControlToValidate="ddlCallMeTime"
                                runat="server" ValidationGroup="callme" CssClass="validationError" ErrorMessage=""
                                InitialValue="-1"></asp:RequiredFieldValidator>
                        </div>
                        <div class="field-row">
                            <html5:TextInput ID="txtName" MaxLength="50" runat="server" CssClass="text-fields"
                                Text="<%$Resources:CarMenu,YourName%>"></html5:TextInput>
                            <asp:RequiredFieldValidator ID="rfvName" runat="server" CssClass="validationError"
                                ValidationGroup="callme" ErrorMessage="" Text="" ControlToValidate="txtName"></asp:RequiredFieldValidator>
                            <asp:RegularExpressionValidator ID="revName" runat="server" ValidationGroup="callme"
                                ValidationExpression="^[\p{L}\d]*[^#$%^&*():/\.'^<>]*$" CssClass="validationError"
                                ControlToValidate="txtName" ErrorMessage=""></asp:RegularExpressionValidator>
                        </div>
                        <div class="field-row">
                            <html5:EmailInput ID="txtEmail" runat="server" MaxLength="80" CssClass="text-fields"
                                Text="<%$Resources:CarInsurance,YourEmail%>"></html5:EmailInput>
                            <asp:RegularExpressionValidator ID="rfvEmail" Text="" CssClass="validationError"
                                runat="server" ValidationGroup="callme" ErrorMessage="" ControlToValidate="txtEmail"
                                ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" Display="Dynamic"></asp:RegularExpressionValidator>
                            <asp:RequiredFieldValidator ID="revEmail" runat="server" Text="" CssClass="validationError"
                                ValidationGroup="callme" ErrorMessage="" ControlToValidate="txtEmail" Display="Dynamic"></asp:RequiredFieldValidator>
                        </div>
                        <div class="field-row">
                            <html5:PhoneInput ID="txtMobile" runat="server" CssClass="text-fields" MaxLength="10"
                                Text="<%$Resources:CarMenu,MobileSample%>"></html5:PhoneInput>
                            <asp:RequiredFieldValidator ID="rfvMobile" runat="server" CssClass="validationError"
                                ValidationGroup="callme" ErrorMessage="" Text="" ControlToValidate="txtMobile"></asp:RequiredFieldValidator>
                            <asp:RegularExpressionValidator ID="revMobile" runat="server" ValidationGroup="callme"
                                ValidationExpression="0[5-9]\d{8}" ControlToValidate="txtMobile" CssClass="validationError"
                                ErrorMessage=""></asp:RegularExpressionValidator>
                        </div>
                        <div class="field-row">
                            <asp:Button runat="server" ID="btnSubmit" Text="<%$Resources:CarMenu,BuyNow%>" CssClass="action-button"
                                OnClick="btnSubmit_Click" ValidationGroup="callme" OnClientClick="LoadValidationErrorCss();if (Page_ClientValidate('callme')){ShowHideDiv('divLoading', true);}"
                                Width="100" />
                            <a href="car-quote.aspx">
                                <div style="float: left;">
                                    <asp:Button runat="server" ID="btnNewQuotes" Text="<%$Resources:CarMenu,NewQuote%>"
                                        CssClass="back-button" OnClick="btnNewQuote_Click" Width="120" />
                                </div>
                            </a>
                        </div>
                        <div>
                            <asp:Label ID="lblErrorMessage" runat="server" ForeColor="Red"></asp:Label>
                        </div>
                    </div>
                    <div id="divCallMeMessage" runat="server" visible="false">
                        <div class="heading-radius">
                            <asp:Label ID="lblThanksTitle" runat="server" Text=""></asp:Label></div>
                        <div class="thanks-text">
                            <p class="thanks-para">
                                <asp:Label ID="lblMessage1" runat="server"></asp:Label>
                            </p>
                            <p class="thanks-para">
                                <asp:Label ID="lblMessage2" runat="server"></asp:Label>
                            </p>
                        </div>
                    </div>
                    <div class="chac">
                        <div style="position: absolute; margin-top: 35px; margin-left: 5px;">
                            <img src="../images/hippo-chac.png" width="108" height="86" alt="" />
                        </div>
                    </div>
                </div>
            </div>
            <div style="display: none;">
                <asp:HiddenField ID="hdnUserLoginStatus" runat="server" Value="0" />
                <asp:HiddenField ID="hdnQuoteId" runat="server" Value="0" />
                <asp:HiddenField ID="hdnCarId" runat="server" Value="0" />
                <asp:HiddenField ID="hdnPolicyId" runat="server" Value="0" />
                <asp:HiddenField ID="hdnResults" runat="server" Value="0" />
                <asp:HiddenField ID="hdnEmail" runat="server" Value="" />
                <asp:HiddenField ID="hdnInsuranceType" runat="server" Value="10" />
                <asp:HiddenField ID="hdnIsAceept" runat="server" Value="FALSE" />
            </div>
        </div>
    </div>
    <div class="social-icons">
        <div class="fb-icon">
            <a href="https://www.facebook.com/GGmotor" target="_blank">
                <img src="../images/icons/fb-icon.png" width="53" height="53" alt="" /></a></div>
        <div class="gplus-icon">
            <a href="https://plus.google.com/+Gluaygluay" target="_blank">
                <img src="../images/icons/gplus-icon.png" width="53" height="53" alt="" /></a></div>
        <div class="instagram-icon">
            <a href="http://instagram.com/ggmotor" target="_blank">
                <img src="../images/icons/instagram-variation.png" width="53" height="53" alt="" /></a></div>
        <div class="youtube-icon">
            <a href="http://www.youtube.com/channel/UCZ4gMtlXymBHxvcXO2cR1vA" target="_blank">
                <img src="../images/icons/youtube-variation.png" width="53" height="53" alt="" /></a></div>
    </div>

    <script type="text/javascript">
        $(".detail-expand-btn").click(function() {
            $header = $(this);
            $content = $header.parent().parent().find(".content");
            if ($content.is(":hidden")) {
                $(".content").slideUp(500);
                $content.slideToggle(500, function() {
                    //execute this after slideToggle is done
                });
            }
            else {
                $(".content").slideUp(500);
            }

        });
        
    </script>

    <script type="text/javascript">
        function ConfirmBuy() {
            var _retVal = false;
            _retVal = window.confirm('<%=GetGlobalResourceObject("CarMenu", "WanttoBuy")%>');

            if (_retVal) {
                window.onbeforeunload = null;
            }

            return _retVal;
        }
    </script>

    <script type="text/javascript">
        function ConfirmEmail() {
            var _retVal = false;
            var _message = '<%=GetGlobalResourceObject("CarMenu", "WanttoEmail")%>';
            _message = _message + ' ' + document.getElementById('<%= hdnEmail.ClientID%>').value;

            _retVal = window.confirm(_message);

            if (_retVal) {
                window.onbeforeunload = null;
            }

            return _retVal;
        }
    </script>

    <script type="text/javascript">
        HideLoading();
    </script>

    <!-- Google Code for Results Page Mobile (EN-TH) Conversion Page -->

    <script type="text/javascript">
        /* <![CDATA[ */
        var google_conversion_id = 1013678288;
        var google_conversion_language = "en";
        var google_conversion_format = "3";
        var google_conversion_color = "ffffff";
        var google_conversion_label = "DissCNDAtgIQ0IGu4wM";
        var google_conversion_value = 1.000000;
        var google_remarketing_only = false;
        /* ]]> */
    </script>

    <script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
    </script>

    <noscript>
        <div style="display: inline;">
            <img height="1" width="1" style="border-style: none;" alt="" src="//www.googleadservices.com/pagead/conversion/1013678288/?value=1.000000&amp;label=DissCNDAtgIQ0IGu4wM&amp;guid=ON&amp;script=0" />
        </div>
    </noscript>
</asp:Content>
